#include<stdio.h>
#include<stdlib.h>

#include"../data_structure/BinaryTree.h"

typedef struct TreeNode TreeNode;

void preTra_recur(TreeNode* node, int* res, int* i)
{
    if(node != NULL)
    {
        res[(*i)++] = node->val;
        preTra_recur(node->left,res,i);
        preTra_recur(node->right,res,i);
    }
}

int* preorderTraversal(TreeNode * root, int* returnSize)
{
    const int NUM = 100;
    int* res = malloc(NUM * sizeof(int));
    *returnSize = 0;

    preTra_recur(root,res,returnSize);

    return res;
}


int main(int argc, char* argv[])
{
    

    return 0;
}